﻿<UserControl x:Class="FeedNews.Views.FeedNewsBoardView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="{Binding UserControlHeigth, Mode=TwoWay}" d:DesignWidth="{Binding UserControlWidth,Mode=TwoWay}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="{Binding DockHeight}" />
                <RowDefinition Height="*" />
                <RowDefinition Height="150" />
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" Background="#FF202020">
            <ScrollViewer 
                Style="{StaticResource ScrollViewerStyle}" 
                Width="Auto"
                Height="{Binding DockHeight,Mode=TwoWay}"
                Template="{DynamicResource ScrollViewerControlTemplate}" >
                <DockPanel Width="Auto" Height="{Binding DockHeight,Mode=TwoWay}">
                    <ItemsControl ItemsSource="{Binding MyData}">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal" />
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Image 
                                        Source="{Binding UpdateNotiIcon}"
                                        Style="{StaticResource NotiStyle}"  />
                                    <Button 
                                Margin="10" 
                                Width="{Binding IconWidth}"
                                Focusable ="False"
                                ToolTip="{Binding Content}"
                                Command="{Binding Command}"
                                Style="{DynamicResource IconButtonStyle}" >
                                        <Image Source="{Binding Logo}" />
                                    </Button>
                                </Grid>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </DockPanel>
            </ScrollViewer>
        </Grid>
            <Grid Grid.Row="1">
                <!-- Picture -->
                <Image  
                Name="myImage" 
                ToolTip="{Binding CurrentFeedName}"
                Source="{Binding imgPath}" 
                RenderOptions.BitmapScalingMode="HighQuality"/>
                <Button 
                Style="{StaticResource RSSFeedBoardViewButtonStyle}" 
                HorizontalAlignment ="Right"
                Command="{Binding Next}">
                    <Image 
                    Style="{StaticResource NextPrevButtonImagStyle}" >
                        <Image.RenderTransform>
                            <ScaleTransform ScaleX="1.0" ScaleY="1.0"/>
                        </Image.RenderTransform>
                    </Image>
                </Button>
                <Button 
                Style="{StaticResource RSSFeedBoardViewButtonStyle}"
                HorizontalAlignment ="Left"
                Command="{Binding Prev}">
                    <Image 
                    Style="{StaticResource NextPrevButtonImagStyle}" >
                        <Image.RenderTransform>
                            <ScaleTransform ScaleX="-1.0" ScaleY="-1.0"/>
                        </Image.RenderTransform>
                    </Image>
                </Button>
                <Image 
                Source="{Binding CurrentFeedThumb}"
                Width="50"
                Height="50"
                Margin="10"
                ToolTip="{Binding CurrentFeedName}"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"/>
            <Image 
                    Source="{Binding IsReadAlready}"
                    VerticalAlignment="Top"
                    HorizontalAlignment="Right"
                    Margin="0,0,10,0"
                    Stretch="None">
                <Image.Effect>
                    <DropShadowEffect ShadowDepth="0" Color="White" Opacity="1" BlurRadius="20"/>
                </Image.Effect>
            </Image>

            </Grid>

        <Grid Grid.Row="2"  Background="#FF202020"  Opacity="{Binding IsReadAlready}" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="60" />
                    <RowDefinition Height="70" />
                    <RowDefinition Height="23"/>
                </Grid.RowDefinitions>
                <!-- Headline -->
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="{Binding HeaderWidth,Mode=TwoWay}"/>
                        <ColumnDefinition Width="60" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <TextBlock 
                        Name="Title"
                        Style="{StaticResource headerTextStyle}"  
                        Text="{Binding itemTitle}" />
                    </Grid>
                    <Grid Grid.Column="1">
                        <Image
                        Style="{StaticResource CalendarStyle}"/>
                        <TextBlock 
                        Text="{Binding itemMonth}" 
                        FontSize="18"
                        FontWeight="DemiBold"
                        Foreground="White"
                        HorizontalAlignment="Center"/>
                        <TextBlock 
                        Text="{Binding itemDay}" 
                        FontSize="36"
                        FontWeight="DemiBold"
                        HorizontalAlignment="Center"
                        Margin="0,12"/>
                    </Grid>
                </Grid>
                <Grid Grid.Row="1" Background="#FF404040">
                    <StackPanel>
                        <TextBlock
                        Text="{Binding itemTimeSpan}"
                        Foreground="DeepSkyBlue"
                        Margin="10,0,0,5"/>

                        <TextBlock 
                        Name="newsContent"
                        Style="{StaticResource textStyle}" 
                        Text="{Binding itemDescr}"/>
                    </StackPanel>
                </Grid>
                <Grid Grid.Row="2" Background="#FF454545"/>
            </Grid>
        </Grid>
</UserControl>
